/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package MetricsRetriever;

import MetricsRetriever.RetrieverComponents.Matcher;
import MetricsRetriever.RetrieverComponents.RepositoryManager;
import MetricsRetriever.RetrieverComponents.MetricsManager;
import MetricsRetriever.RetrieverComponents.BugManager;
import DataStructures.BugData;
import DataStructures.Metrics;
import DataStructures.ProjectInformation;
import DataStructures.RevisionInformation;
import java.util.ArrayList;
import java.util.HashMap;

/**
 *
 * @author Manuel
 */
public class ConcreteRetriever extends Retriever{


    public ConcreteRetriever(ProjectInformation info) {
        projectInfo = info;
    }

    public ProjectInformation getContextData() {
        return projectInfo;
    }

    public HashMap getMetrics(){
        if(metricsManager != null){
            HashMap mx = metricsManager.getAllCodeMetrics();
            return mx;
        }
        return null;
    }

    public HashMap<Integer, RevisionInformation> getRepositoryData(int r) {
        if(repositoryManager != null){
            HashMap<Integer, RevisionInformation> rd = repositoryManager.getAllRepositoryData(r);
            return rd;
        }
        return null;
    }


    public BugData getBugData() {
        if(this.bugManager != null){
            BugData bd = bugManager.getAllBugData();
            return bd;
        }
        return null;
    }

    public void setBugManager(BugManager bm) {
        this.bugManager = bm;
    }

    public void setMetricsMeasurer(MetricsManager mm) {
        this.metricsManager = mm;
    }

    public void setRepositoryManager(RepositoryManager rm) {
        this.repositoryManager = rm;
    }

    public boolean hasBugManager() {
        if(this.bugManager != null)
            return true;
        else
            return false;
    }

    public boolean hasMetricsManager() {
        if(this.metricsManager != null)
            return true;
        else
            return false;
    }

    public boolean hasRepositoryManager() {
        if(this.repositoryManager != null)
            return true;
        else
            return false;
    }

    public Matcher getMatcher() {
        return this.matcher;
    }

    public void setMatcher(Matcher m) {
        this.matcher = m;
    }



}
